
#pragma once

#include <memory>
#include <thread>
#include <mutex>

#include <QApplication>
#include <QObject>
#include <QString>
#include <QTimer>
#include <GL/glut.h>
#include <QMainWindow>
#include <QtGui>
#include <QtWidgets>
#include "ccGLWidget.h"
#include "ccEDLFilter.h"
#include "ccPickingListener.h"
#include "ccPickingHub.h"
#include "ccPointCloud.h"
#include "ccHObject.h"
#include "ManualSegmentationTools.h"
#include "ccPolyline.h"
#include "ccSphere.h"
#include "ccPlane.h"
#include "param_reader.h"
class ViewWindow : public QMainWindow
{
    Q_OBJECT
    
public:

    ViewWindow(QWidget *parent = NULL);
    
    ~ViewWindow();
    
    ccGLWindow* getActiveGLWindow();
   
	void addToDB(ccHObject* entity,ccGLWindow* detWin);
    void setPath(QString path);
    void getColorRamp(float minz, float maxz, float pz, float &r, float &g, float &b);
    void drawPlane(int x1, int y1, int x2, int y2);
    void drawBox(CCVector3 P1, CCVector3 P2, CCVector3 P3);
    void removePlane();
    void readLAS(QString path);
    void readPCD(QString path);
    void readYaml(QString path);
    void setCurrentHeight(int height);
    void setPoints(QVector<QVector<QPointF>> vec);


private:
    QMdiArea* m_mdiArea;

    ccGLWindow* new3DView( bool allowEntitySelection );

    ccPointCloud *entity_pc;
    std::vector<ccPlane*> box;
    float currentImageRes = 0.0;
    float originMapX = 0.0;
    float originMapY = 0.0; 
    int currentImageHeight =0;
};
